cmake_minimum_required(VERSION 3.12)
project(lib_nbd C)

set(CMAKE_C_STANDARD 11)

include_directories(.)

add_definitions("-D_GNU_SOURCE")
add_definitions("-DNODAEMON")
link_directories(${CMAKE_SOURCE_DIR})

set(SOURCES
    server/cliserv.c
    server/nbd_server.c
    server/expand_stdio.c
    server/nbd_cmd.c
    server/nbd_main.c
    )

add_executable(nbd-server ${SOURCES})
target_link_libraries(nbd-server pthread)

add_definitions("-DSYSCONFDIR=\"/usr/local/etc\"")

#add_executable(nbd-client
#    client/cliserv.c
#    client/nbd-client.c
#    )
#target_link_libraries(nbd-client glib-2.0 pthread)
